# $Id$
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=libwnck3
pkgver=3.24.1
pkgrel=1
pkgdesc="Library to manage X windows and workspaces (via pagers, tasklists, etc.)"
url="https://git.gnome.org/browse/libwnck"
arch=(i686 x86_64)
license=(LGPL)
depends=(gtk3 startup-notification libxres)
makedepends=(intltool gobject-introspection python2 gtk-doc gnome-common git)
_commit=eb80bc83a9e4094aa46aae4adf4d055c0854709b  # tags/3.24.1^0
source=("git+https://git.gnome.org/browse/libwnck#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd libwnck
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd libwnck
  NOCONFIGURE=1 ./autogen.sh
}

build() {
    cd libwnck
    ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
      --disable-static --enable-gtk-doc --enable-compile-warnings

  # https://bugzilla.gnome.org/show_bug.cgi?id=655517
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

    make
}

check() {
    cd libwnck
    make -k check
}

package() {
    cd libwnck
    make DESTDIR="$pkgdir" install
}
